home *** CD-ROM | disk | FTP | other *** search
- Path: news.unt.edu!news
- From: Steve Fogoros <sfogoros@hsc.unt.edu>
- Newsgroups: comp.lang.c
- Subject: Re: Borland sqrt() bug?
- Date: Fri, 08 Mar 1996 13:34:38 -0800
- Organization: University of North Texas Health Science Center
- Message-ID: <3140A7EE.1DA3@hsc.unt.edu>
- References: <4hotp5$a1h@news.hk.linkage.net>
- NNTP-Posting-Host: sfogoros.hsc.unt.edu
- Mime-Version: 1.0
- Content-Type: text/plain; charset=us-ascii
- Content-Transfer-Encoding: 7bit
- X-Mailer: Mozilla 2.0 (Win16; I)
-
- Priscilla Ngie wrote:
- >
- > I tired the following code
- >
- > float num;
- > if (num > 0) sqrt(num);
- >
- > and Borland C++ 4.02 returns me with an error
- >
- > sqrt: DOMAIN error
- >
- > This error dialog box only pops up when num is a +ve number approaching
- > zero, eg 0.000000005.
- >
- > Is this a bug of some kind? If not, how can I trun around this?
- >
- > Priscilla Ngie
- > Future Solutions
- > Hong Kong
-
- sqrt() takes a double as its argument and returns a double. Declare num
- as double or cast it to double.
-
- --
- Steve Fogoros, Academic Information Coordinator
- University of North Texas Health Science Center
- sfogoros@hsc.unt.edu
-